﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChatServerApp.Classes
{
    [Serializable]
    public class User_Complete : User
    {
        private string _pw;
        private string _ip;
        private string _port;
        private List<string> _contacts;
        private bool _isOnline;

        public string Pw
        {
            get { return _pw; }
            set { _pw = value; }
        }

        public string Ip
        {
            get { return _ip; }
            set { _ip = value; }
        }

        public string Port
        {
            get { return _port; }
            set { _port = value; }
        }

        public List<string> Contacts
        {
            get { return _contacts; }
            set { _contacts = value; }
        }

        public bool IsOnline
        {
            get { return _isOnline; }
            set { _isOnline = value; }
        }

        public User_Complete()
        {

        }

        public User_Complete(string name, string vorname, string email, string pw, string nickname, string jahrgang) : base(name, vorname, email, nickname, jahrgang)
        {
            _pw = pw;
            _isOnline = false;
            _contacts = new List<string>();
            _ip = String.Empty;
            _port = String.Empty;
        }

        public void Update(string ip, string port, bool isOnline)
        {
            _isOnline = isOnline;
            _ip = ip;
            _port = port;
        }

        public User getUser()
        {
            return new User(this.Name, this.Vorname, this.Email, this.Nick, this.Jahrgang);
        }
    }
}
